package com.simple.chiralium.upms.biz.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.simple.chiralium.common.core.util.Result;
import com.simple.chiralium.upms.api.dto.UserInfo;
import com.simple.chiralium.upms.api.entity.SysUser;

/**
 * 系统用户服务
 *
 * @author SimpleZzz
 * @date 2021/12/05
 */
public interface SysUserService extends IService<SysUser> {

    /**
     * 添加用户
     *
     * @param user 用户
     * @return {@link Result}<{@link String}>
     */
    Result<String> addUser(SysUser user);

    /**
     * 更新用户
     *
     * @param user 用户
     * @return {@link Result}<{@link String}>
     */
    Result<String> updateUserById(SysUser user);

    /**
     * 通过pkId删除用户
     *
     * @param id id
     * @return {@link Result}<{@link String}>
     */
    Result<String> deleteUserById(String id);

    /**
     * 根据sysUser查询该用户role、menu信息并封装成UserInfo
     *
     * @param sysUser 系统用户
     * @return {@link UserInfo}
     */
    UserInfo getUserInfo(SysUser sysUser);
}
